Fix read_page markdown rendering in chat display#335
Conversation
RichContentRenderer now intelligently detects whether content is HTML (from TipTap editor) or markdown/plain text and handles each appropriately. Previously, markdown content was rendered as plain text in a <pre> tag because isMarkdown prop defaulted to false and content detection only ran after (skipped) markdown conversion. https://claude.ai/code/session_01VrkwJzzussmyQ4JNvQeurt
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e4e4a8fa8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Convert to HTML: | ||
| // - If content is already HTML, preserve it (markdownToHtml would escape the tags) | ||
| // - If content is not HTML (markdown or plain text), convert markdown to HTML | ||
| // - isMarkdown prop can force markdown conversion for edge cases | ||
| const html = (contentIsHtml && !isMarkdown) ? rawContent : markdownToHtml(rawContent); | ||
|
|
There was a problem hiding this comment.
Preserve plain text when isMarkdown is false
This change now converts any non-HTML content through markdownToHtml even when isMarkdown is false. That means plain text (e.g., code snippets, JSON, or pages stored as plain text) will be interpreted as markdown and rendered with formatting, which can alter or remove literal characters like _ and *. Previously, with isMarkdown false, the renderer preserved the raw text in a <pre> block, so content fidelity was maintained. This is a behavioral regression for any non-markdown page content that includes markdown-like tokens.
Useful? React with 👍 / 👎.
https://claude.ai/code/session_01VrkwJzzussmyQ4JNvQeurt